home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 8: LINUX Games
/
Linux Cubed Series 8 - LINUX Games.iso
/
games
/
x11
/
strategy
/
xpuzzles.3
/
xpuzzles
/
xpuzzles-5.3.1
/
xmlink
/
MlinkP.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-02-05
|
3KB
|
123 lines
/*
# X-BASED MISSING LINK(tm)
#
# MlinkP.h
#
###
#
# Copyright (c) 1994 - 96 David Albert Bagley, bagleyd@hertz.njit.edu
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and
# that both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of the author not be
# used in advertising or publicity pertaining to distribution of the
# software without specific, written prior permission.
#
# This program is distributed in the hope that it will be "playable",
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
*/
/* Private header file for Mlink */
#ifndef _MlinkP_h
#define _MlinkP_h
#include "Mlink.h"
/*** random number generator ***/
/* insert your favorite */
extern void SetRNG();
extern long LongRNG();
#define SRAND(X) SetRNG((long) X)
#define LRAND() LongRNG()
#define NRAND(X) ((int)(LRAND()%(X)))
#define SYMBOL ':'
#define TOP 0
#define RIGHT 1
#define BOTTOM 2
#define LEFT 3
#define COORD 4
/* The following are in xmlink.c also */
#define MINFACES 1
#define MAXFACES 8
#define MINTILES 1
#define DEFAULTTILES 4
#define DEFAULTFACES 4
#define ABS(a) (((a)<0)?(-a):(a))
#define SIGN(a) (((a)<0)?(-1):1)
#define MIN(a,b) (((int)(a)<(int)(b))?(int)(a):(int)(b))
#define MAX(a,b) (((int)(a)>(int)(b))?(int)(a):(int)(b))
typedef struct _MlinkPart
{
Pixel foreground;
Pixel tileColor, borderColor;
Pixel faceColor[MAXFACES];
int *tileOfPosition, spacePosition;
int currentTile, currentFace, currentRef;
Boolean started, orient, mono, middle;
int depth;
int base;
int tiles, faces, tileFaces;
XPoint offset, tileSize, faceSize, puzzleSize;
XPoint delta, puzzleOffset, digitOffset;
GC puzzleGC;
GC tileGC;
GC borderGC;
GC faceGC[MAXFACES];
GC inverseGC;
String faceName[MAXFACES];
XtCallbackList select;
} MlinkPart;
typedef struct _MlinkRec
{
CorePart core;
MlinkPart mlink;
} MlinkRec;
/* This gets around C's inability to do inheritance */
typedef struct _MlinkClassPart
{
int ignore;
} MlinkClassPart;
typedef struct _MlinkClassRec
{
CoreClassPart core_class;
MlinkClassPart mlink_class;
} MlinkClassRec;
extern MlinkClassRec mlinkClassRec;
extern int *startPosition;
extern int MoveMlink();
/*extern void SolveTiles();*/ /* For future auto-solver */
extern void DrawAllTiles();
extern Boolean CheckSolved();
extern void InitMoves();
extern void PutMove();
extern void GetMove();
extern int MadeMoves();
extern void FlushMoves();
extern int NumMoves();
extern void ScanMoves();
extern void PrintMoves();
extern void ScanStartPosition();
extern void PrintStartPosition();
extern void SetStartPosition();
#endif /* _MlinkP_h */